import { createRouter, createWebHistory } from 'vue-router'
import Index from '../views/Index.vue'

const routes = [
  {
    path: '*',
    name: '404',
  },

  {
    path: '/',
    name: 'Index',
    component: Index,
  },
]

const router = createRouter({
  // eslint-disable-next-line no-underscore-dangle
  base: window.__POWERED_BY_QIANKUN__
    ? `${process.env.VUE_APP_PATH}home/`
    : '/',
  history: createWebHistory(),
  routes,
})

export default router
